package mv.wap;

import mv.util.EncryptionUtil;

/**
 * Class description...
 *
 * @author mvu
 */
public class Paragraph extends Element{
  private String _text;
  private String _title;

  public Paragraph(String text){
    this("", text);
  }

  public Paragraph(String title, String text){
    super();
    _text = text;
    _title = title;
  }
  
  @Override
  String toHtml(Element parent) {
    return new StringBuilder().append("<h2>").append(_title).append("</h2>")
            .append("<p>")
            .append("<script language=\"javascript\">document.write(decrypt('")
            .append(EncryptionUtil.encrypt(_text))
            .append("'))</script>").append("</p>")
            .toString();
  }
}
